package com.metier;

import java.io.Serializable;


/**
 * This is an object that contains data related to the uti_etu table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="uti_etu"
 */

public abstract class BaseUtiEtu  implements Serializable {

	public static String REF = "UtiEtu";


	// constructors
	public BaseUtiEtu () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUtiEtu (
		com.metier.Etude fkEtude,
		com.metier.Utilisateur fkUser) {

		this.setFkEtude(fkEtude);
		this.setFkUser(fkUser);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key

	private com.metier.Etude fkEtude;

	private com.metier.Utilisateur fkUser;



	/**
     * @hibernate.property
     *  column=fk_etude
	 * not-null=true
	 */
	public com.metier.Etude getFkEtude () {
		return this.fkEtude;
	}

	/**
	 * Set the value related to the column: fk_etude
	 * @param fkEtude the fk_etude value
	 */
	public void setFkEtude (com.metier.Etude fkEtude) {
		this.fkEtude = fkEtude;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
     * @hibernate.property
     *  column=fk_user
	 * not-null=true
	 */
	public com.metier.Utilisateur getFkUser () {
		return this.fkUser;
	}

	/**
	 * Set the value related to the column: fk_user
	 * @param fkUser the fk_user value
	 */
	public void setFkUser (com.metier.Utilisateur fkUser) {
		this.fkUser = fkUser;
		this.hashCode = Integer.MIN_VALUE;
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.metier.UtiEtu)) return false;
		else {
			com.metier.UtiEtu utiEtu = (com.metier.UtiEtu) obj;
			if (null != this.getFkEtude() && null != utiEtu.getFkEtude()) {
				if (!this.getFkEtude().equals(utiEtu.getFkEtude())) {
					return false;
				}
			}
			else {
				return false;
			}
			if (null != this.getFkUser() && null != utiEtu.getFkUser()) {
				if (!this.getFkUser().equals(utiEtu.getFkUser())) {
					return false;
				}
			}
			else {
				return false;
			}
			return true;
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			StringBuilder sb = new StringBuilder();
			if (null != this.getFkEtude()) {
				sb.append(this.getFkEtude().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			if (null != this.getFkUser()) {
				sb.append(this.getFkUser().hashCode());
				sb.append(":");
			}
			else {
				return super.hashCode();
			}
			this.hashCode = sb.toString().hashCode();
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}